package com.wuwie.article.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

@Document(collection = "Comment")
@CompoundIndex( def = "{'userid': 1, 'nickname': -1}") //复合索引
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SubComment {
    private String id;

    /**
     * 文章ID
     */
    private String articleid;

    /**
     * 评论内容
     */
    @Field("content")
    private String content;

    /**
     * 评论人ID
     */
    private String userid;

    /**
     * 评论人昵称
     */
    private String nickname;

    /**
     * 评论的日期时间
     */
    private Date createdatetime;

    /**
     * 点赞数
     */
    private Integer likenum;

    /**
     * 回复数
     */
    private Integer replynum;

    /**
     * 状态
     */
    private String state;

    /**
     * 上级ID
     */
    private String parentid;
}
